package org.keyyond.ms.commonservice.service.impl;

import java.util.List;

import org.keyyond.ms.commonservice.dao.FDFBBimsSysMessageDao;
import org.keyyond.ms.commonservice.model.FDFBBimsSysMessage;
import org.keyyond.ms.commonservice.service.MsSysMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MsSysMessageServiceImpl implements MsSysMessageService {
	
	@Autowired
	private FDFBBimsSysMessageDao sysMessageDao;

	@Override
	public String addMessageInSite(FDFBBimsSysMessage record) {
		// TODO Auto-generated method stub
		int count = sysMessageDao.insert(record);
		return record.getSeqno();
	}

	@Override
	public List<FDFBBimsSysMessage> selectMessagesByUseridAndStatus(String username, String status,
			String messageType) {
		// TODO Auto-generated method stub
		return sysMessageDao.selectMessagesByUseridAndStatus(username, status, messageType);
	}

	@Override
	public int updateRecordsBySeqno(FDFBBimsSysMessage record) {
		// TODO Auto-generated method stub
		return sysMessageDao.updateByPrimaryKey(record);
	}

	@Override
	public FDFBBimsSysMessage selectByPrimaryKey(String seqno) {
		// TODO Auto-generated method stub
		return sysMessageDao.selectByPrimaryKey(seqno);
	}

	@Override
	public int updateRecordsStatusToReaded(String username, String messageType) {
		// TODO Auto-generated method stub
		return sysMessageDao.updateRecordsStatusToReaded(username, messageType);
	}

}
